<template>
	<layout :loading="loading" curPage="daliyItems" title="日常维护项目">
		
		<block slot="title">
			<authNav href="/pages/daliyItems/daliyItemsEdit" url="/admin/daliyItems/save" class="layui-btn layui-btn-sm">
				<i class="layui-icon layui-icon-add-1"></i>
				添加
			</authNav>
		</block>

		<div class="layui-form layui-border-box layui-table-view">

			<tableList :list="list" :canSelect="false">

				<block slot="head">
					<th>排序</th>
					<th>类型</th>
					<th>间隔天数</th>
					<th>标题</th>
					<th class="autoWidth">维护内容</th>
					<th>操作</th>
				</block>

				<block slot="body">

					<tr v-for="( x , index) in list" :key="index">
						<td>
							{{x.orderNum}}
						</td>
						<td>
							{{x.type == 1 ? '废水' : '废气'}}
						</td>
						<td>
							{{x.duration}}天
						</td>
						<td>
							{{x.title}}
						</td>
						<td>
							{{x.content}}
						</td>
						<td>
							<authNav :href="'/pages/daliyItems/daliyItemsEdit?id=' + x.id" url="/admin/daliyItems/save" class="layui-btn layui-btn-xs">
								编辑
							</authNav>
							<authBtn :url="'/admin/daliyItems/delete?id='+x.id" confirm="delete" class="layui-btn layui-btn-xs">
								删除
							</authBtn>
						</td>
					</tr>

				</block>

			</tableList>
			
			<emptyTips :loading="loading" :list="list"></emptyTips>
			
		</div>


	</layout>
</template>

<script>
	export default {
		data() {
			return {
				loading: true ,
				action: "/admin/daliyItems/list",
				list: [],
			}
		},
		
		onLoad:function(res){
			
		},

		onShow() {
			this.loadData();
		},

		methods: {
			loadData:function(e){
				this.kit.getList(this.action);
			}
		}
	}
</script>